package com.thinkgem.jeesite.modules.cms.web;


import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.cms.entity.TaskOperation;
import com.thinkgem.jeesite.modules.cms.service.TaskOperationService;
import com.thinkgem.jeesite.modules.sys.entity.User;
import com.thinkgem.jeesite.modules.sys.service.SystemService;
@Controller
@RequestMapping(value = "${adminPath}/cms/taskChange")
public class TaskChangeController  extends BaseController {
	
	@Autowired
	private TaskOperationService taskOperationService;
	
	@Autowired
	private SystemService systemService;
	
	@RequestMapping(value ={"change"})
	public String list(TaskOperation taskOperation, HttpServletRequest request, HttpServletResponse response, Model model) {
		Page<TaskOperation> page = taskOperationService.findPageForChange(new Page<TaskOperation>(request, response), taskOperation); 
		List<User> userList =  systemService.findAllInUser();
		model.addAttribute("page", page);
		model.addAttribute("userList", userList);
		return "modules/cms/taskChange";//"redirect:"+Global.getAdminPath()+"/cms/taskinput/?repage";//
	}
	

	@RequestMapping(value ={""})
	public String list2(TaskOperation taskOperation, HttpServletRequest request, HttpServletResponse response, Model model) {
		return "modules/cms/taskChange";//"redirect:"+Global.getAdminPath()+"/cms/taskinput/?repage";//
	}
	
}
